1. Technical Field
The invention relates to an apparatus and a file editing method and, more particularly, a technique for segmenting a file, like an audio data file.
2. Related Art
In connection with various types of recording-reproducing apparatus, techniques for effecting edition, such as changing of alignment sequence of files recorded in a recording medium and segmentation, concatenation, appending, and deletion, and the like, of the files have hitherto been known. Undo techniques for revoking editing operations have been known with this.
Among various types of edition, file segmentation operation is processing for segmenting one file recorded in a recording medium into two sub-files or more and recording the thus-segmented files again in the recording medium. For instance, a certain audio file A recorded in a certain track is assumed to be segmented into two files, or file A1 and file A2, at an arbitrary point desired by a user.
A method for editing files generally includes destructive edition and non-destructive edition. Non-destructive edition is apparent edition achieved by separately retaining edited information while keeping an original file intact. On the contrary, destructive edition is achieved by taking the original file itself as objectives of edition. Accordingly, non-destructive edition is comparatively easy in connection with Undo processing for revoking editing operation. In the case of destructive edition, since the original file itself is edited, Undo processing becomes complicate and entails consumption of much time.
FIGS. 5A and 5B schematically show destructive edition of file segmentation. FIG. 5A shows a file to be segmented; for instance, an audio file 100 composed of audio data. Segmentation of an audio file needs segmenting data at an arbitrary position. In the meantime, when audio data are managed by use of a file system, like an FAT (File Allocation Table), data are read and written on a per-cluster basis. In the drawings, a demarcation line between clusters that is a basic unit for reading and writing data is designated by a separator line. Since data read/write operation is carried out on a per-cluster basis, segmentation is also, naturally performed on a per-cluster basis. Accordingly, performing segmentation in a unit which is smaller than a cluster requires processing for copying data and aligning the thus-copied data to a demarcation between clusters.
Specifically, when a segmentation point is set at a position that is not on the demarcation between clusters as illustrated in FIG. 5A, data belonging to one cluster that includes the segmentation point are copied. Subsequently as shown in FIG. 5B, the audio file 100 to be segmented is segmented into a first half audio file 100a and a last half audio file 100b along the demarcation between clusters including the segmentation point. On this occasion, copied data pertaining to one cluster are appended to the last half audio file 100b. In addition, a file header that is a copy of a file header 101 of the original audio file 100 is appended to a head of the last half audio file 100b. Since the file header 101 appended to the head can also be written only on a per-cluster basis as in the case with audio data, one cluster including the file header 101 is appended to the head of the last half audio file 100b. No data exist in, except an area of the file header 101, a data field that is an equivalent of one cluster including the file header 101. Therefore, the area of the data field unoccupied by data is filled with dummy data. Accordingly, the last half audio file 100b is configured in such a way that the file header 101 is followed by the dummy data 102 and that the dummy data 102 are also followed by the data that are originally subsequent to the segmentation point.
FIGS. 6A and 6B show (Undo) processing for revoking an audio file that have undergone destructive segmentation under the method shown in FIGS. 5A and 5B. FIG. 6A shows the two audio files 100a and 100b that have been destructively segmented. In operation for revoking segmentation; namely, concatenating operation, the file header 101 appended to the head of the last half audio file 100b is deleted, and the last half audio file 100b is concatenated with a tail end of the first half audio file 100a. However, as mentioned above, reading and writing of data can be performed only on a per-cluster basis. Consequently, when a total size of data pertaining to a final cluster of the first half audio file 100a and data belonging to a starting cluster of the last half audio file 100b exclusive of the file header 101 are not congruous with the size of a cluster unit, the entirety of the last half audio file except the file header 101 must be copied such that the total size becomes congruous with the size of the cluster unit. In FIG. 6A, when a total size of hatched data belonging to the first half audio file 100a and hatched data belonging to the last half audio file 100b except the file header 101 is not congruous with the size of the cluster unit, the entirety of the data belonging to the last half audio file 100b is copied and concatenated with the tail end of the first half audio file 100a as shown in FIG. 6B.
JP 2003-323267 A discloses (Undo) operation for revoking not destructive edition but non-destructive edition. Specifically, according to descriptions of JP 2003-323267 A, in addition to retaining first management data including management information corresponding to details of finally-performed edition, a PC retains second management data including management information achieved immediately before being updated to the management information. Thus, the PC executes Undo operation without retaining a state achieved before edition. JP 10-293989 A discloses first memory means for storing ancillary data read from a mini disk and second memory means for storing data pertaining to a pointer area that is changed in association with execution of edition processing, such as deletion, movement, segmentation, and concatenation of recorded data in the ancillary data stored in the first memory means. It also discloses that there is performed control operation for rewriting the ancillary data stored in the first memory means on the basis of data pertaining to the pointer area stored in the second memory means at the time of revocation or re-execution of edition processing.
As above, since the (Undo) operation for revoking destructive segmentation entails edition of the original file itself, revoke processing becomes complicate. Specifically, when the size of a concatenated area between the first half file and the last half file that have been obtained by segmenting a file is not congruous with the size of a cluster unit that is the unit for reading and writing data, there arises a necessity for copying the entirety of the data pertaining to the last half file, which entails complicate operation and consumption of much time. In particular, when a volume of data pertaining to the last half file is large, a volume of data to be copied also increases accordingly, which raises a problem of much time being consumed by revoke processing.
Moreover, additional information, like chunk data, may be appended to the end of the file depending on a file format. In this case, since the additional information is already formed at the end of the first half file after segmentation, revoke processing becomes more complicate.